// components/mybutton/mybutton.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    type: {
      type: String,
      value: 'rect'
    },
    color: {
      type: String,
      value: '#36D'
    },
    text: {
      type: String,
      value: '默认按钮'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    time : 0
  },
  /** 组件的方法列表 */
  methods: {
    /** 点击view时触发 */
    tapEvent(){
      let time = this.data.time;
      let now = new Date().getTime();
      console.log('点了view'+now);
      if(now-time < 350){ // 捕获到了双击事件的产生
        this.triggerEvent('doubletap');
      }
      this.data.time = now;
    }
  }
})
